#!/usr/bin/env python
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from google.appengine.dist import use_library
use_library('django', '1.2')

import wsgiref.handlers
from google.appengine.ext import webapp
import logging

from model import StudentM

class StudentVoteDeleteHandler(webapp.RequestHandler):
    
    def get(self):
        topicKey=self.request.get('topicKey')
        
        if topicKey:
#       logging.debug("\n\n\nStudentVoiceHandler, lectureKey: "+lectureKey+"\n\n\n")
            StudentM.deletePrevStudentVotes(topicKey)
        
def main():
    logging.getLogger().setLevel(logging.DEBUG)
    app = webapp.WSGIApplication([
        (r'.*', StudentVoteDeleteHandler)], debug=True)
    wsgiref.handlers.CGIHandler().run(app)

if __name__ == "__main__":
    main()